<?php 
function delete($tbl,$columns=null,$value=null)
{
	$where=$columns==0?' ':'where'.$columns.' = '.$value ;
	$sql = "delete from {$tbl}{$where}";
	$result = mysql_query($sql);
	if($result)
	{
		return mysql_affected_rows();
	}
	else 
	{
		return false;
	}
}
function update($tbl,$data,$where=null){
  $sets='';
    foreach ($data as $key=>$val){
        $sets .=$key . "='" . $val . "',";
    }
    $sets=rtrim($sets,','); 
    $where=$where==null?'':' WHERE '.$where;
    $sql="UPDATE {$tbl} SET {$sets} {$where}";  
    $res=mysql_query($sql);
    if ($res){
        return mysql_affected_rows();
    }else {
        return false;
    }
}
function insert($tbl,$array)
{
	$sets=' ';
	foreach ($array as $k => $v) {
		$where = 
	}
}
 ?>